//---------------------------------------------------------------------------

#ifndef LIPMCommunicatorH
#define LIPMCommunicatorH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include "YbCommDevice.h"
#include <ExtCtrls.hpp>

#define SET_LIPM_PARAMETER_T		243
#define SET_LIPM_PARAMETER_L		242
#define GENERATE_LIPM_MOTION		241
#define RUN_LIPM_MOTION					240
#define SHOW_LIPM_PARAMETER			239

#define BUF_LIPM_SIZE						300

//---------------------------------------------------------------------------
class TFormLIPM : public TForm
{
__published:	// IDE-managed Components
	TGroupBox *GroupBox1;
	TLabel *Label1;
	TLabel *Label2;
	TLabel *Label3;
	TLabel *Label4;
	TLabel *Label5;
	TLabel *Label6;
	TLabel *Label7;
	TLabel *Label8;
	TEdit *Edit_LIPM_T;
	TEdit *Edit_LIPM_TimeSize;
	TEdit *Edit_LIPM_dt;
	TEdit *Edit_LIPM_StepY;
	TEdit *Edit_LIPM_StepZ;
	TEdit *Edit_LIPM_MovingX;
	TEdit *Edit_LIPM_RTheta;
	TEdit *Edit_LIPM_RepeatCount;
	TEdit *Edit_LIPM_tSSP;
	TButton *Button_LIPM_GenerateMotion;
	TButton *Button_LIPM_RunMotion;
	TLabel *Label9;
	TLabel *Label10;
	TEdit *Edit_LIPM_SpeedFactor;
	TMemo *Memo_LIPM_Show;
	TYbCommDevice *YbCommDeviceLIPM;
	TButton *Button_LIPM_CommSetting;
	TButton *Button_LIPM_CommSwitch;
	TButton *Button_LIPM_MemoClear;
	TTimer *Timer_LIPM;
	TCheckBox *CheckBox_Numerical;
	TButton *Button_LIPM_ShowParameter;
	void __fastcall Button_LIPM_CommSettingClick(TObject *Sender);
	void __fastcall Button_LIPM_CommSwitchClick(TObject *Sender);
	void __fastcall Button_LIPM_GenerateMotionClick(TObject *Sender);
	void __fastcall Button_LIPM_RunMotionClick(TObject *Sender);
	void __fastcall Button_LIPM_MemoClearClick(TObject *Sender);
	void __fastcall Timer_LIPMTimer(TObject *Sender);
	void __fastcall Button_LIPM_ShowParameterClick(TObject *Sender);
private:	// User declarations
public:		// User declarations
	__fastcall TFormLIPM(TComponent* Owner);
	void SetParameterConstraint(void);
	void Send(unsigned char *Tx, int length);
};
//---------------------------------------------------------------------------
extern PACKAGE TFormLIPM *FormLIPM;
//---------------------------------------------------------------------------
#endif
